/**
 * @file led.h
 * @author morris (a_morris@163.com)
 * @brief
 * @version 0.1
 * @date 2022-04-02
 *
 * @copyright Copyright (c) 2022
 *
 */
#ifndef __BSP_LED_H__
#define __BSP_LED_H__

#include "bk8400.h"

#define run_led_on()    Gpio_SetIO(RUN_LED_GPIO_PORT, RUN_LED_GPIO_PIN)
#define run_led_off()   Gpio_ClrIO(RUN_LED_GPIO_PORT, RUN_LED_GPIO_PIN)
#define run_led_state() Gpio_GetInputIO(RUN_LED_GPIO_PORT, RUN_LED_GPIO_PIN)

#define alarm_led_on()    Gpio_SetIO(ALARM_LED_GPIO_PORT, ALARM_LED_GPIO_PIN)
#define alarm_led_off()   Gpio_ClrIO(ALARM_LED_GPIO_PORT, ALARM_LED_GPIO_PIN)
#define alarm_led_state() Gpio_GetInputIO(ALARM_LED_GPIO_PORT, ALARM_LED_GPIO_PIN)

#define fault_led_on()    Gpio_SetIO(FAULT_LED_GPIO_PORT, FAULT_LED_GPIO_PIN)
#define fault_led_off()   Gpio_ClrIO(FAULT_LED_GPIO_PORT, FAULT_LED_GPIO_PIN)
#define fault_led_state() Gpio_GetInputIO(FAULT_LED_GPIO_PORT, FAULT_LED_GPIO_PIN)






/**
 * @brief led init
 *
 */
void led_init(void);

/**
 * @brief led delay
 *
 * @param ms
 */
 
void led_alarm_on_delay(uint32_t ms);
void led_run_on_delay(uint32_t ms);
void led_fault_on_delay(uint32_t ms);
void led_fault_off(uint32_t ms);

void leds_set_pulse_out(uint16_t t1, uint16_t t2);
void leds_set_pulse_off(void);


#endif /* __BSP_LED_H__ */
